<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>tinydtls: dtls.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">tinydtls
   &#160;<span id="projectnumber">0.8.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">dtls.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>High level DTLS API and visible structures.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stdint.h&gt;</code><br/>
<code>#include &quot;<a class="el" href="t__list_8h_source.html">t_list.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="state_8h_source.html">state.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="peer_8h_source.html">peer.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="uthash_8h_source.html">uthash.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="alert_8h_source.html">alert.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="crypto_8h_source.html">crypto.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="hmac_8h_source.html">hmac.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="global_8h_source.html">global.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="dtls__time_8h_source.html">dtls_time.h</a>&quot;</code><br/>
</div>
<p><a href="dtls_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structdtls__ecdsa__key__t.html">dtls_ecdsa_key_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structdtls__handler__t.html">dtls_handler_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structdtls__context__t.html">dtls_context_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:af0c44db3bf3a6a52e9ed271218daeaa6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#af0c44db3bf3a6a52e9ed271218daeaa6">DTLS_VERSION</a>&#160;&#160;&#160;0xfefd	/* DTLS v1.2 */</td></tr>
<tr class="separator:af0c44db3bf3a6a52e9ed271218daeaa6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44ec206b1d84aa3d83281a92ed7cc238"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a44ec206b1d84aa3d83281a92ed7cc238">DTLS_COOKIE_SECRET_LENGTH</a>&#160;&#160;&#160;12</td></tr>
<tr class="separator:a44ec206b1d84aa3d83281a92ed7cc238"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a89611ebcb02bb3bbf56dfb583937586e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a89611ebcb02bb3bbf56dfb583937586e">dtls_set_app_data</a>(CTX, DATA)&#160;&#160;&#160;((CTX)-&gt;app = (DATA))</td></tr>
<tr class="separator:a89611ebcb02bb3bbf56dfb583937586e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a95f7eb485bb814aa308e2612681176d9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a95f7eb485bb814aa308e2612681176d9">dtls_get_app_data</a>(CTX)&#160;&#160;&#160;((CTX)-&gt;app)</td></tr>
<tr class="separator:a95f7eb485bb814aa308e2612681176d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a09e4f571633bdb724236ac68459715b6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a09e4f571633bdb724236ac68459715b6">DTLS_COOKIE_LENGTH</a>&#160;&#160;&#160;16</td></tr>
<tr class="separator:a09e4f571633bdb724236ac68459715b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3114c327a12e3850e97c4cf8a0cc5c9d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a3114c327a12e3850e97c4cf8a0cc5c9d">DTLS_CT_CHANGE_CIPHER_SPEC</a>&#160;&#160;&#160;20</td></tr>
<tr class="separator:a3114c327a12e3850e97c4cf8a0cc5c9d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af8ce2230240b6d3c36b216ef459baff1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#af8ce2230240b6d3c36b216ef459baff1">DTLS_CT_ALERT</a>&#160;&#160;&#160;21</td></tr>
<tr class="separator:af8ce2230240b6d3c36b216ef459baff1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a76965db5ec449b3c8a9a54c24a4d45dc"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a76965db5ec449b3c8a9a54c24a4d45dc">DTLS_CT_HANDSHAKE</a>&#160;&#160;&#160;22</td></tr>
<tr class="separator:a76965db5ec449b3c8a9a54c24a4d45dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2e3ff1e96b8b7db8a3648beba35bfd0c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a2e3ff1e96b8b7db8a3648beba35bfd0c">DTLS_CT_APPLICATION_DATA</a>&#160;&#160;&#160;23</td></tr>
<tr class="separator:a2e3ff1e96b8b7db8a3648beba35bfd0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a66566dfd30b8ab388c08b4cde6c667cc"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a66566dfd30b8ab388c08b4cde6c667cc">DTLS_HT_HELLO_REQUEST</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:a66566dfd30b8ab388c08b4cde6c667cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a25f0afef67a1fd8d9e3e61074d11e2f5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a25f0afef67a1fd8d9e3e61074d11e2f5">DTLS_HT_CLIENT_HELLO</a>&#160;&#160;&#160;1</td></tr>
<tr class="separator:a25f0afef67a1fd8d9e3e61074d11e2f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad5882a5ff4073ffefa266bb2c4a1ee3c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#ad5882a5ff4073ffefa266bb2c4a1ee3c">DTLS_HT_SERVER_HELLO</a>&#160;&#160;&#160;2</td></tr>
<tr class="separator:ad5882a5ff4073ffefa266bb2c4a1ee3c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab04f98f1863c785fabd97925c9746f7d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#ab04f98f1863c785fabd97925c9746f7d">DTLS_HT_HELLO_VERIFY_REQUEST</a>&#160;&#160;&#160;3</td></tr>
<tr class="separator:ab04f98f1863c785fabd97925c9746f7d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a55a0a899d7f151e7f53b76fe8a82c10e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a55a0a899d7f151e7f53b76fe8a82c10e">DTLS_HT_CERTIFICATE</a>&#160;&#160;&#160;11</td></tr>
<tr class="separator:a55a0a899d7f151e7f53b76fe8a82c10e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aab327e17614cf2902c5fc6169466613f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#aab327e17614cf2902c5fc6169466613f">DTLS_HT_SERVER_KEY_EXCHANGE</a>&#160;&#160;&#160;12</td></tr>
<tr class="separator:aab327e17614cf2902c5fc6169466613f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6f49d7b0a6e9190d71d51b1ee9ff3bd5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a6f49d7b0a6e9190d71d51b1ee9ff3bd5">DTLS_HT_CERTIFICATE_REQUEST</a>&#160;&#160;&#160;13</td></tr>
<tr class="separator:a6f49d7b0a6e9190d71d51b1ee9ff3bd5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44399f223a3e1c8a8bf3fc638a06a4d7"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a44399f223a3e1c8a8bf3fc638a06a4d7">DTLS_HT_SERVER_HELLO_DONE</a>&#160;&#160;&#160;14</td></tr>
<tr class="separator:a44399f223a3e1c8a8bf3fc638a06a4d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9abc650dd8339a227ddd165ede9350d0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a9abc650dd8339a227ddd165ede9350d0">DTLS_HT_CERTIFICATE_VERIFY</a>&#160;&#160;&#160;15</td></tr>
<tr class="separator:a9abc650dd8339a227ddd165ede9350d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a577885c74492a460729a451f33a894c4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a577885c74492a460729a451f33a894c4">DTLS_HT_CLIENT_KEY_EXCHANGE</a>&#160;&#160;&#160;16</td></tr>
<tr class="separator:a577885c74492a460729a451f33a894c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16b49d03e041d43b60e1b7bacf35daad"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a16b49d03e041d43b60e1b7bacf35daad">DTLS_HT_FINISHED</a>&#160;&#160;&#160;20</td></tr>
<tr class="separator:a16b49d03e041d43b60e1b7bacf35daad"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:adb4c778ddcbf9ac28ef277b20adbfa33"><td class="memItemLeft" align="right" valign="top">typedef enum <br class="typebreak"/>
<a class="el" href="dtls_8h.html#a36eda3add5e2d12a3b5e2b6fe7038e01">dtls_credentials_type_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#adb4c778ddcbf9ac28ef277b20adbfa33">dtls_credentials_type_t</a></td></tr>
<tr class="separator:adb4c778ddcbf9ac28ef277b20adbfa33"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a472601639fcded4630fbd087f986ad10"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structdtls__ecdsa__key__t.html">dtls_ecdsa_key_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a472601639fcded4630fbd087f986ad10">dtls_ecdsa_key_t</a></td></tr>
<tr class="separator:a472601639fcded4630fbd087f986ad10"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a407c66c58bfc87651714de4103bee135"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structdtls__context__t.html">dtls_context_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a407c66c58bfc87651714de4103bee135">dtls_context_t</a></td></tr>
<tr class="separator:a407c66c58bfc87651714de4103bee135"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a36eda3add5e2d12a3b5e2b6fe7038e01"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a36eda3add5e2d12a3b5e2b6fe7038e01">dtls_credentials_type_t</a> { <a class="el" href="dtls_8h.html#a36eda3add5e2d12a3b5e2b6fe7038e01a53b5588e3c87ce19b1340baf193d130c">DTLS_PSK_HINT</a>, 
<a class="el" href="dtls_8h.html#a36eda3add5e2d12a3b5e2b6fe7038e01adb8cac45614b2bc4e66970b64043cfc2">DTLS_PSK_IDENTITY</a>, 
<a class="el" href="dtls_8h.html#a36eda3add5e2d12a3b5e2b6fe7038e01a1d64c04f18b370cf742595dc91098db4">DTLS_PSK_KEY</a>
 }</td></tr>
<tr class="separator:a36eda3add5e2d12a3b5e2b6fe7038e01"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ac203466e393ac9030d405c8f0496e9cd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#ac203466e393ac9030d405c8f0496e9cd">dtls_init</a> ()</td></tr>
<tr class="separator:ac203466e393ac9030d405c8f0496e9cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a11f53d301448aa8f1dbcfaf77441bd9c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structdtls__context__t.html">dtls_context_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a11f53d301448aa8f1dbcfaf77441bd9c">dtls_new_context</a> (void *app_data)</td></tr>
<tr class="separator:a11f53d301448aa8f1dbcfaf77441bd9c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3171c099d25ed29e31326526b8e1de84"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a3171c099d25ed29e31326526b8e1de84">dtls_free_context</a> (<a class="el" href="structdtls__context__t.html">dtls_context_t</a> *ctx)</td></tr>
<tr class="separator:a3171c099d25ed29e31326526b8e1de84"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab0e3223c87b79e4946b19538b24634da"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#ab0e3223c87b79e4946b19538b24634da">dtls_set_handler</a> (<a class="el" href="structdtls__context__t.html">dtls_context_t</a> *ctx, <a class="el" href="structdtls__handler__t.html">dtls_handler_t</a> *h)</td></tr>
<tr class="separator:ab0e3223c87b79e4946b19538b24634da"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a187f5e145bb869a732fbed426929a4e9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a187f5e145bb869a732fbed426929a4e9">dtls_connect</a> (<a class="el" href="structdtls__context__t.html">dtls_context_t</a> *ctx, const <a class="el" href="structsession__t.html">session_t</a> *dst)</td></tr>
<tr class="separator:a187f5e145bb869a732fbed426929a4e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad60bf1197fa1a074f91aed508cfefa62"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#ad60bf1197fa1a074f91aed508cfefa62">dtls_connect_peer</a> (<a class="el" href="structdtls__context__t.html">dtls_context_t</a> *ctx, <a class="el" href="structdtls__peer__t.html">dtls_peer_t</a> *peer)</td></tr>
<tr class="separator:ad60bf1197fa1a074f91aed508cfefa62"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa90f5eb6954137d5e098e29143c2586a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#aa90f5eb6954137d5e098e29143c2586a">dtls_close</a> (<a class="el" href="structdtls__context__t.html">dtls_context_t</a> *ctx, const <a class="el" href="structsession__t.html">session_t</a> *remote)</td></tr>
<tr class="separator:aa90f5eb6954137d5e098e29143c2586a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5676a0ceeeabd1ec38d378212f7af4a1"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a5676a0ceeeabd1ec38d378212f7af4a1">dtls_renegotiate</a> (<a class="el" href="structdtls__context__t.html">dtls_context_t</a> *ctx, const <a class="el" href="structsession__t.html">session_t</a> *dst)</td></tr>
<tr class="separator:a5676a0ceeeabd1ec38d378212f7af4a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4743f51c3197d290fc9a88e1f3a64928"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a4743f51c3197d290fc9a88e1f3a64928">dtls_write</a> (struct <a class="el" href="structdtls__context__t.html">dtls_context_t</a> *ctx, <a class="el" href="structsession__t.html">session_t</a> *session, <a class="el" href="global_8h.html#adde6aaee8457bee49c2a92621fe22b79">uint8</a> *buf, size_t len)</td></tr>
<tr class="separator:a4743f51c3197d290fc9a88e1f3a64928"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab50d1ee589e91d07032d0a65768dee82"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#ab50d1ee589e91d07032d0a65768dee82">dtls_check_retransmit</a> (<a class="el" href="structdtls__context__t.html">dtls_context_t</a> *context, <a class="el" href="group__clock.html#ga6e6c13e871b82d881a01d1bc8df69d23">clock_time_t</a> *next)</td></tr>
<tr class="separator:ab50d1ee589e91d07032d0a65768dee82"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad09246453a4dabd919c7541484046a87"><td class="memItemLeft" align="right" valign="top">struct&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#ad09246453a4dabd919c7541484046a87">__attribute__</a> ((__packed__))</td></tr>
<tr class="separator:ad09246453a4dabd919c7541484046a87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae272fea7269714fe7a67d6da64961731"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#ae272fea7269714fe7a67d6da64961731">dtls_handle_message</a> (<a class="el" href="structdtls__context__t.html">dtls_context_t</a> *ctx, <a class="el" href="structsession__t.html">session_t</a> *session, <a class="el" href="global_8h.html#adde6aaee8457bee49c2a92621fe22b79">uint8</a> *msg, int msglen)</td></tr>
<tr class="separator:ae272fea7269714fe7a67d6da64961731"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3fd062108e5d0f48627ae644546824a6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structdtls__peer__t.html">dtls_peer_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a3fd062108e5d0f48627ae644546824a6">dtls_get_peer</a> (const <a class="el" href="structdtls__context__t.html">dtls_context_t</a> *context, const <a class="el" href="structsession__t.html">session_t</a> *session)</td></tr>
<tr class="separator:a3fd062108e5d0f48627ae644546824a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a81936df7abb2c16aa897e3018aa24399"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a81936df7abb2c16aa897e3018aa24399">dtls_record_header_t</a></td></tr>
<tr class="separator:a81936df7abb2c16aa897e3018aa24399"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c6625ffcf61189392768253e8919a45"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#a5c6625ffcf61189392768253e8919a45">dtls_handshake_header_t</a></td></tr>
<tr class="separator:a5c6625ffcf61189392768253e8919a45"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa9ebc35a08295c2ae09d4248ba8e6456"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#aa9ebc35a08295c2ae09d4248ba8e6456">dtls_client_hello_t</a></td></tr>
<tr class="separator:aa9ebc35a08295c2ae09d4248ba8e6456"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abd61d526ef995e63a6debfd8ddda9e98"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dtls_8h.html#abd61d526ef995e63a6debfd8ddda9e98">dtls_hello_verify_t</a></td></tr>
<tr class="separator:abd61d526ef995e63a6debfd8ddda9e98"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>High level DTLS API and visible structures. </p>

<p>Definition in file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a09e4f571633bdb724236ac68459715b6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_COOKIE_LENGTH&#160;&#160;&#160;16</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00323">323</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="a44ec206b1d84aa3d83281a92ed7cc238"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_COOKIE_SECRET_LENGTH&#160;&#160;&#160;12</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Length of the secret that is used for generating Hello Verify cookies. </p>

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00071">71</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="af8ce2230240b6d3c36b216ef459baff1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_CT_ALERT&#160;&#160;&#160;21</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00326">326</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="a2e3ff1e96b8b7db8a3648beba35bfd0c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_CT_APPLICATION_DATA&#160;&#160;&#160;23</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00328">328</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="a3114c327a12e3850e97c4cf8a0cc5c9d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_CT_CHANGE_CIPHER_SPEC&#160;&#160;&#160;20</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00325">325</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="a76965db5ec449b3c8a9a54c24a4d45dc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_CT_HANDSHAKE&#160;&#160;&#160;22</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00327">327</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="a95f7eb485bb814aa308e2612681176d9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dtls_get_app_data</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">CTX</td><td>)</td>
          <td>&#160;&#160;&#160;((CTX)-&gt;app)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00259">259</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="a55a0a899d7f151e7f53b76fe8a82c10e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_HT_CERTIFICATE&#160;&#160;&#160;11</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00346">346</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="a6f49d7b0a6e9190d71d51b1ee9ff3bd5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_HT_CERTIFICATE_REQUEST&#160;&#160;&#160;13</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00348">348</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="a9abc650dd8339a227ddd165ede9350d0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_HT_CERTIFICATE_VERIFY&#160;&#160;&#160;15</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00350">350</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="a25f0afef67a1fd8d9e3e61074d11e2f5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_HT_CLIENT_HELLO&#160;&#160;&#160;1</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00343">343</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="a577885c74492a460729a451f33a894c4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_HT_CLIENT_KEY_EXCHANGE&#160;&#160;&#160;16</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00351">351</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="a16b49d03e041d43b60e1b7bacf35daad"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_HT_FINISHED&#160;&#160;&#160;20</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00352">352</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="a66566dfd30b8ab388c08b4cde6c667cc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_HT_HELLO_REQUEST&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00342">342</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="ab04f98f1863c785fabd97925c9746f7d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_HT_HELLO_VERIFY_REQUEST&#160;&#160;&#160;3</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00345">345</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="ad5882a5ff4073ffefa266bb2c4a1ee3c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_HT_SERVER_HELLO&#160;&#160;&#160;2</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00344">344</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="a44399f223a3e1c8a8bf3fc638a06a4d7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_HT_SERVER_HELLO_DONE&#160;&#160;&#160;14</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00349">349</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="aab327e17614cf2902c5fc6169466613f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_HT_SERVER_KEY_EXCHANGE&#160;&#160;&#160;12</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00347">347</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="a89611ebcb02bb3bbf56dfb583937586e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dtls_set_app_data</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">CTX, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">DATA&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;((CTX)-&gt;app = (DATA))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00258">258</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="af0c44db3bf3a6a52e9ed271218daeaa6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DTLS_VERSION&#160;&#160;&#160;0xfefd	/* DTLS v1.2 */</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00056">56</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="a407c66c58bfc87651714de4103bee135"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structdtls__context__t.html">dtls_context_t</a>  <a class="el" href="structdtls__context__t.html">dtls_context_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Holds global information of the DTLS engine. </p>

</div>
</div>
<a class="anchor" id="adb4c778ddcbf9ac28ef277b20adbfa33"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef enum <a class="el" href="dtls_8h.html#a36eda3add5e2d12a3b5e2b6fe7038e01">dtls_credentials_type_t</a>  <a class="el" href="dtls_8h.html#a36eda3add5e2d12a3b5e2b6fe7038e01">dtls_credentials_type_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a472601639fcded4630fbd087f986ad10"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structdtls__ecdsa__key__t.html">dtls_ecdsa_key_t</a>  <a class="el" href="structdtls__ecdsa__key__t.html">dtls_ecdsa_key_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="a36eda3add5e2d12a3b5e2b6fe7038e01"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="dtls_8h.html#a36eda3add5e2d12a3b5e2b6fe7038e01">dtls_credentials_type_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a36eda3add5e2d12a3b5e2b6fe7038e01a53b5588e3c87ce19b1340baf193d130c"></a>DTLS_PSK_HINT</em>&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a36eda3add5e2d12a3b5e2b6fe7038e01adb8cac45614b2bc4e66970b64043cfc2"></a>DTLS_PSK_IDENTITY</em>&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a36eda3add5e2d12a3b5e2b6fe7038e01a1d64c04f18b370cf742595dc91098db4"></a>DTLS_PSK_KEY</em>&#160;</td><td class="fielddoc">
</td></tr>
</table>

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00059">59</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ad09246453a4dabd919c7541484046a87"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct __attribute__ </td>
          <td>(</td>
          <td class="paramtype">(__packed__)&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Generic header structure of the DTLS record layer.</p>
<p>Header structure for the DTLS handshake protocol.</p>
<p>Structure of the Client Hello message.</p>
<p>Structure of the Hello Verify Request. </p>
<p>&lt; content type of the included message</p>
<p>&lt; Protocol version</p>
<p>&lt; counter for cipher state changes</p>
<p>&lt; sequence number</p>
<p>&lt; length of the following fragment</p>
<p>&lt; Type of handshake message (one of DTLS_HT_)</p>
<p>&lt; length of this message</p>
<p>&lt; Message sequence number</p>
<p>&lt; Fragment offset.</p>
<p>&lt; Fragment length.</p>
<p>&lt; Client version</p>
<p>&lt; GMT time of the random byte creation</p>
<p>&lt; Client random bytes</p>
<p>&lt; Server version</p>
<p>&lt; Length of the included cookie</p>
<p>&lt; up to 32 bytes making up the cookie </p>

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00331">331</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="ab50d1ee589e91d07032d0a65768dee82"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dtls_check_retransmit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structdtls__context__t.html">dtls_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__clock.html#ga6e6c13e871b82d881a01d1bc8df69d23">clock_time_t</a> *&#160;</td>
          <td class="paramname"><em>next</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Checks sendqueue of given DTLS context object for any outstanding packets to be transmitted.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The DTLS context object to use. </td></tr>
    <tr><td class="paramname">next</td><td>If not NULL, <code>next</code> is filled with the timestamp of the next scheduled retransmission, or <code>0</code> when no packets are waiting. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="dtls_8c_source.html#l03957">3957</a> of file <a class="el" href="dtls_8c_source.html">dtls.c</a>.</p>

</div>
</div>
<a class="anchor" id="aa90f5eb6954137d5e098e29143c2586a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int dtls_close </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structdtls__context__t.html">dtls_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structsession__t.html">session_t</a> *&#160;</td>
          <td class="paramname"><em>remote</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Closes the DTLS connection associated with <code>remote</code>. This function returns zero on success, and a value less than zero on error. </p>

<p>Definition at line <a class="el" href="dtls_8c_source.html#l01494">1494</a> of file <a class="el" href="dtls_8c_source.html">dtls.c</a>.</p>

</div>
</div>
<a class="anchor" id="a187f5e145bb869a732fbed426929a4e9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int dtls_connect </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structdtls__context__t.html">dtls_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structsession__t.html">session_t</a> *&#160;</td>
          <td class="paramname"><em>dst</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Establishes a DTLS channel with the specified remote peer <code>dst</code>. This function returns <code>0</code> if that channel already exists, a value greater than zero when a new ClientHello message was sent, and a value less than zero on error.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>The DTLS context to use. </td></tr>
    <tr><td class="paramname">dst</td><td>The remote party to connect to. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A value less than zero on error, greater or equal otherwise. </dd></dl>

<p>Definition at line <a class="el" href="dtls_8c_source.html#l03862">3862</a> of file <a class="el" href="dtls_8c_source.html">dtls.c</a>.</p>

</div>
</div>
<a class="anchor" id="ad60bf1197fa1a074f91aed508cfefa62"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int dtls_connect_peer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structdtls__context__t.html">dtls_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structdtls__peer__t.html">dtls_peer_t</a> *&#160;</td>
          <td class="paramname"><em>peer</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Establishes a DTLS channel with the specified remote peer. This function returns <code>0</code> if that channel already exists, a value greater than zero when a new ClientHello message was sent, and a value less than zero on error.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>The DTLS context to use. </td></tr>
    <tr><td class="paramname">peer</td><td>The peer object that describes the session. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A value less than zero on error, greater or equal otherwise. </dd></dl>

<p>Definition at line <a class="el" href="dtls_8c_source.html#l03826">3826</a> of file <a class="el" href="dtls_8c_source.html">dtls.c</a>.</p>

</div>
</div>
<a class="anchor" id="a3171c099d25ed29e31326526b8e1de84"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dtls_free_context </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structdtls__context__t.html">dtls_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Releases any storage that has been allocated for <code>ctx</code>. </p>

<p>Definition at line <a class="el" href="dtls_8c_source.html#l03802">3802</a> of file <a class="el" href="dtls_8c_source.html">dtls.c</a>.</p>

</div>
</div>
<a class="anchor" id="a3fd062108e5d0f48627ae644546824a6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structdtls__peer__t.html">dtls_peer_t</a>* dtls_get_peer </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structdtls__context__t.html">dtls_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structsession__t.html">session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Check if <code>session</code> is associated with a peer object in <code>context</code>. This function returns a pointer to the peer if found, NULL otherwise.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The DTLS context to search. </td></tr>
    <tr><td class="paramname">session</td><td>The remote address and local interface </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the peer associated with <code>session</code> or NULL if none exists. </dd></dl>

<p>Definition at line <a class="el" href="dtls_8c_source.html#l00212">212</a> of file <a class="el" href="dtls_8c_source.html">dtls.c</a>.</p>

</div>
</div>
<a class="anchor" id="ae272fea7269714fe7a67d6da64961731"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int dtls_handle_message </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structdtls__context__t.html">dtls_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structsession__t.html">session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="global_8h.html#adde6aaee8457bee49c2a92621fe22b79">uint8</a> *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>msglen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Handles incoming data as DTLS message from given peer.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>The dtls context to use. </td></tr>
    <tr><td class="paramname">session</td><td>The current session </td></tr>
    <tr><td class="paramname">msg</td><td>The received data </td></tr>
    <tr><td class="paramname">msglen</td><td>The actual length of <code>msg</code>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A value less than zero on error, zero on success.</dd></dl>
<p>Handles incoming data as DTLS message from given peer. </p>

<p>Definition at line <a class="el" href="dtls_8c_source.html#l03591">3591</a> of file <a class="el" href="dtls_8c_source.html">dtls.c</a>.</p>

</div>
</div>
<a class="anchor" id="ac203466e393ac9030d405c8f0496e9cd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dtls_init </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function initializes the tinyDTLS memory management and must be called first. </p>

<p>Definition at line <a class="el" href="dtls_8c_source.html#l00163">163</a> of file <a class="el" href="dtls_8c_source.html">dtls.c</a>.</p>

</div>
</div>
<a class="anchor" id="a11f53d301448aa8f1dbcfaf77441bd9c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structdtls__context__t.html">dtls_context_t</a>* dtls_new_context </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>app_data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Creates a new context object. The storage allocated for the new object must be released with <a class="el" href="dtls_8h.html#a3171c099d25ed29e31326526b8e1de84">dtls_free_context()</a>. </p>

<p>Definition at line <a class="el" href="dtls_8c_source.html#l03740">3740</a> of file <a class="el" href="dtls_8c_source.html">dtls.c</a>.</p>

</div>
</div>
<a class="anchor" id="a5676a0ceeeabd1ec38d378212f7af4a1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int dtls_renegotiate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structdtls__context__t.html">dtls_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structsession__t.html">session_t</a> *&#160;</td>
          <td class="paramname"><em>dst</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8c_source.html#l02956">2956</a> of file <a class="el" href="dtls_8c_source.html">dtls.c</a>.</p>

</div>
</div>
<a class="anchor" id="ab0e3223c87b79e4946b19538b24634da"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void dtls_set_handler </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structdtls__context__t.html">dtls_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structdtls__handler__t.html">dtls_handler_t</a> *&#160;</td>
          <td class="paramname"><em>h</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Sets the callback handler object for <code>ctx</code> to <code>h</code>. </p>

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00262">262</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="a4743f51c3197d290fc9a88e1f3a64928"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int dtls_write </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdtls__context__t.html">dtls_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structsession__t.html">session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="global_8h.html#adde6aaee8457bee49c2a92621fe22b79">uint8</a> *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Writes the application data given in <code>buf</code> to the peer specified by <code>session</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>The DTLS context to use. </td></tr>
    <tr><td class="paramname">session</td><td>The remote transport address and local interface. </td></tr>
    <tr><td class="paramname">buf</td><td>The data to write. </td></tr>
    <tr><td class="paramname">len</td><td>The actual length of <code>data</code>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes written or <code>-1</code> on error. </dd></dl>

<p>Definition at line <a class="el" href="dtls_8c_source.html#l00236">236</a> of file <a class="el" href="dtls_8c_source.html">dtls.c</a>.</p>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="aa9ebc35a08295c2ae09d4248ba8e6456"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">dtls_client_hello_t</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00373">373</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="a5c6625ffcf61189392768253e8919a45"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">dtls_handshake_header_t</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00362">362</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="abd61d526ef995e63a6debfd8ddda9e98"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">dtls_hello_verify_t</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00380">380</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
<a class="anchor" id="a81936df7abb2c16aa897e3018aa24399"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">dtls_record_header_t</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="dtls_8h_source.html#l00338">338</a> of file <a class="el" href="dtls_8h_source.html">dtls.h</a>.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Feb 27 2015 15:15:33 for tinydtls by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>
